open(BUFF,"rlmlist_cis_out_filetered.txt");
$line = <BUFF>;
chomp($line);
while(<BUFF>)
{
	chomp($_);
	@array = split(/\t/,$_);
	$hash{"$array[1]_$array[0]"} = 1;

}
open(BUFF,"./results_permutation_pavl_filtered/PVAL.txt") or die "no file exists\n";
open(WRBUFF,">filtered_cis_out.txt") or die "no file exists\n";
$line = <BUFF>;
chomp($line);
print WRBUFF $line."\n";

while(<BUFF>)
{
        chomp($_);
        @array = split(/\t/,$_);
	if(exists($hash{"$array[0]_$array[1]"}))
	{
		print WRBUFF $_."\n";
	}
}
